#ifndef _GSM_COMMANDRESPONSE_H_
#define _GSM_COMMANDRESPONSE_H_

#include <stdint.h>
#include "GSMData.h"
#include "dataIO.h"

class GSMCommandResponse {
protected:
	char tempCommand[64]; 	// "32 bytes ought to be anough for anyone"
	char tempResponse[256]; // some of those bastards get long.
	DataInput* dataInput;
	DataOutput* dataOutput;
	uint16_t sendString(const char* string);
	uint16_t sendCommand(const char* command);

public:
	GSMCommandResponse(DataInput* input, DataOutput* output);

	/*
	 * Should send the null-terminated command to the modem and block
	 * waiting for the response.
	 */
	int8_t executeCommand(char* command, char* response, uint32_t timeout);
	bool getPhonebookNumber(const char* name, PhonebookEntry* result);
	bool getCellData(CellData* result);
	bool sendSMS(SMS& sms);
	bool newReceivedSMS(SMS& sms);
};

#endif
